<template>
  <view class="main-pd u-p-t-28">
    <view v-if="dataList.length && !loading">
      <view
        class="wy-item"
        @click="$u.route('/pagesA/hswy/hswy?id=' + item.wyId)"
        v-for="item in dataList"
        :key="item.wyId"
        >{{ item.wyName }}</view
      >
    </view>
    <view class="u-m-30" v-show="loading">
      <u-skeleton rows="5" title loading></u-skeleton>
    </view>
    <view class="empty-con">
      <u-empty mode="list" :show="!dataList.length && !loading"></u-empty>
    </view>
  </view>
</template>

<script setup>
import { onLoad } from "@dcloudio/uni-app";
import { gethswyListApi } from "@/api/index";
import { useList } from "@/hooks/useList";
const { loadData, dataList, page, loading } = useList({
  listApi: gethswyListApi,
});
onLoad((param) => {
  page.value = 1;
  dataList.value = [];
  loadData();
});
</script>

<style lang="scss" scoped>
.wy-item {
  background-color: #fff;
  padding: 20rpx 0;
  text-align: center;
  font-size: 28rpx;
  color: #333;
  margin-bottom: 14rpx;
}
</style>
